package com.gdqy.FCS.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gdqy.FCS.dao.BrandDao;
import com.gdqy.FCS.entity.Brand;

@Service
@Transactional
public class BrandService {
	
	@Autowired
	private BrandDao brandDao;
	
	//通过供应商id查询供应商品牌数目
	public int selectCountByEnterprise_id(int enterprise_id){
		return brandDao.selectCountByEnterprise_id(enterprise_id);
	}
	//查询所有品牌
	public List<Brand> selectAll(){
		return brandDao.selectAll();
	}
	//通过id查询品牌
	public Brand selectById(int id){
		return brandDao.selectById(id);
	}
	//通话供应商id查询品牌
	public List<Brand> selectByEnterprise_id(int enterprise_id) {
		return brandDao.selectByEnterprise_id(enterprise_id);
	}
	//新增品牌
	public int insert(Brand brand){
		return brandDao.insert(brand);
	}
	//通过id删除品牌
	public int deleteById(int brand_id){
		return brandDao.deleteById(brand_id);
	}
	//修改品牌
	public int update(Brand brand){
		return brandDao.update(brand);
	}
	//通过字典服装的分类来获取品牌
	public List<Brand> selectByClothing_type(String big_code,String middle_code,String small_code) {
		return brandDao.selectByClothing_type(big_code, middle_code, small_code);
	}
	//通过字典服装的分类来获取品牌NEW
	public List<Brand> getBrandByClothing(String code) {
		return brandDao.getBrandByClothing(code);
	}
}
